/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.cvut.fel.taskpro.business.isupport;

import cz.cvut.fel.taskpro.business.support.BusinessRuleException;
import cz.cvut.fel.taskpro.business.support.TaskProException;
import cz.cvut.fel.taskpro.data.entity.SystemEnviroment;
import java.io.File;
import java.util.List;
import javax.ejb.Local;

/**
 * This interface is local interface and provide all system enviroment on business
 * level.
 * @author Tom
 * @version 1.0.0. beta
 */
@Local
public interface IEnviromentBusiness {
    /**
     * This method return all enviroment.
     * @return all enviroment setting
     */
   public List<SystemEnviroment> getAllEnviromentSetting();
   /**
    * This method return value of keyOfValue. If the keyOsValue is uknow return null
    * @param keyOfValue key to search
    * @return value which is specifi by keyOfValue
    */
   public String getValueOfEnviroment(String keyOfValue);
   /**
    * This method add system enviroments which are specify in parameter. All enviroments
    * must pass throught validation
    * @param enviroments evnviroments, which will be added
    */
   public void addEnviroment(List<SystemEnviroment> enviroments)throws BusinessRuleException;
   /**
   * This method add system enviroment which is specify in parameter. Enviroment
    * must pass throught validation
    * @param enviroment enviroment, which will be add.
    */
   public void addEnviroment(SystemEnviroment enviroment)throws BusinessRuleException;
   /**
    * This metohod update current eviromnet. If there is no persisted object in
    * param list, then is created as new enviroment
    * @param enviroment enviroments which will be removed
    */
   public void updateEnviroments(List<SystemEnviroment> enviroment)throws BusinessRuleException;
   /**
    * This method remove all enviroments, which are in param list
    * @param enviromentToDelete enviroment which will be removed
    */
   public void removeEnviroments(List<SystemEnviroment> enviromentToDelete);
   /**
    * This method create new enviroment based on imput file
    * @param fileWithSetting file with enviroments
    */
   public List<SystemEnviroment> importEnviroment(File fileWithSetting)throws TaskProException;
   /**
    * This method refresh all currenty loaded enviroment. So if service ask for a current
    * enviroment they get the latest one
    */
   public void refresh();
}
